<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php 
	$ci= & get_instance();
	$USER = $ci->user_entity->init('id',$items->getUserCreatedId());
?>
	
<form action="<?php echo site_url('admin/dataman/show/submit_information');?>" name="submit_information" id="submit_information" method="post" enctype="multipart/form-data" encoding="multipart/form-data" >
	
	<div class="row" style="width:100%;">
		
		<div class="column grid_9">
			<div class="column grid_2"><span class="red">*</span>Show Name:</div>
			<div class="column grid_4">
				<input type="text" maxlength="250" name="show_name" id="show_name" value="<?php echo $items->getName();?>" size="40" />
			</div>
			<div class="column grid_2 hidden" id="show_name_error">
				<span class="red">Please fill show name.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Show type:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'show_type',
										$options = showTypeDataConfig(),
										$selected = explode(',', $items->getShowType()),
										"id='show_type' class='width270'"
									);?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Duration of show:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'show_duration',
										$options = durationOfShowDataConfig(),
										$selected = explode(',', $items->getShowDuration()),
										"id='show_duration' class='width270'"
									);	
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Artist:</div>
			<div class="column grid_4">
				<input type="text" maxlength="200" name="artist" id="artist" value="<?php echo $items->getArtist();?>" size="40" />
			</div>
			<div class="column grid_2 hidden" id="artist_error">
				<span class="red">Please fill artist.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Country of origin:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'country_origin',
										$options = countryOriginDataConfig(),
										$selected = explode(',', $items->getCountryOriginCode()),
										"id='country_origin' class='width270'"
									);	
				?>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2"><span class="red">*</span>Bid Open To:</div>
			<div class="column grid_6">
				<div style="border:1px solid #cccccc;padding:5px;margin:5px 0px;">
					<?php 
						$bidOpen = "";
						$array = explode(',', $items->getBidType());
						foreach( bidOpenToDataConfig() as $key => $value){
							$checked = in_array($key, $array) ? 'checked="checked"': "";
							$bidOpen .= "<input $checked type='checkbox' name='bid_open[]' id='__$key' value='$key' />&nbsp;$value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
						}
						echo $bidOpen ;
					?>
					<div class="clrboth"></div>
					<span class="red hidden" id="bid_open_error">Please check bid open to.</span>
				</div>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Music Genre:</div>
			<div class="column grid_6">
				<div style="border:1px solid #cccccc;padding:5px;">
					<?php 
						$music_genre = "";
						$i = 1;
						$array = explode(',', $items->getMusicGenre());
						foreach ( musicGenreDataConfig() as $key => $value ){
							if($i % 5 == 0){
								$br = "<br/>";
							}else{
								$br = "";
							}
							$checked = in_array($key, $array) ? 'checked="checked"': "";
							$i++;
							$music_genre .= "<input $checked type='checkbox' name='music_genre[]' id='music_genre[]' value='$key' />&nbsp;$value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$br";
						}
						echo $music_genre;
					?>
					<div class="clrboth"></div>
					<span class="red hidden" id="music_genre_error">Please check music genre.</span>
				</div>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Speaker Profile:</div>
			<div class="column grid_6">
				<div style="border:1px solid #cccccc;padding:5px;margin:5px 0px;">
					<?php 
						$speaker_profile = "";
						$array = explode(',', $items->getSpeakerProfile());
						foreach ( speakerProfileDataConfig() as $key => $value ){
							$checked = in_array($key, $array) ? 'checked="checked"': "";
							$speaker_profile .= "<input $checked type='checkbox' name='speaker_profile[]' id='speaker_profile[]' value='$key' />&nbsp;$value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
						}
						echo $speaker_profile;
					?>
					<div class="clrboth"></div>
					<span class="red hidden" id="speaker_profile_error">Please check speaker profile.</span>
				</div>
			</div>
			
			<div class="clrboth"></div>
			<div class="column grid_2">Plays & Musicals:</div>
			<div class="column grid_6">
				<div style="border:1px solid #cccccc;padding:5px;margin:5px 0px;">
					<?php 
						$plays_musicals = "";
						$array = explode(',', $items->getPlaysMusicals());
						foreach ( playsMusicalsDataConfig() as $key => $value ){
							$checked = in_array($key, $array) ? 'checked="checked"': "";
							$plays_musicals .= "<input $checked type='checkbox' name='plays_musicals[]' id='plays_musicals[]' value='$key' />&nbsp;$value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
						}
						echo $plays_musicals;
					?>
					<div class="clrboth"></div>
					<span class="red hidden" id="plays_musicals_error">Please check plays and musicals.</span>
				</div>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Period of Travel:</div>
			<div class="column grid_6">
				<input type="text" name="start_date" id="start_date" value="<?php echo sbxDateFormat($items->getStartDate(),'d-F-Y')?>" size="20" /> 
				&nbsp;-&nbsp;
				<input type="text" name="end_date" id="end_date" value="<?php echo sbxDateFormat($items->getEndDate(),'d-F-Y')?>" size="20" />
				<div class="clrboth"></div>
				<span class="red hidden" id="period_error">Please choose valid start date and end date.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Bid Due Date:</div>
			<div class="column grid_6">
				<input type="text" name="bid_due_date" id="bid_due_date" value="<?php echo sbxDateFormat($items->getBidDueDate(),'d-F-Y')?>" size="20" /> 
				<span class="red hidden" id="bid_due_date_error">Please choose valid bid due date.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Booking available for:</div>
			<div class="column grid_4">
				<?php 
					echo form_multiselect( 'available_for[]',
										$options = countryZoneDataConfig(),
										$selected = explode(',', $items->getAvailableFor()),
										"id='available_for[]' class='width270'"
									);	
				?>
			</div>
			<div class="column grid_2 hidden" id="available_for_error">
				<span class="red">Please select booking available for.</span>
			</div>
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Entourage Number:</div>
			<div class="column grid_4">
				<input type="text" maxlength="10" name="entourage_no" id="entourage_no" value="<?php echo $items->getEntourageNo();?>" size="40" /> PAX
			</div>
			<div class="column grid_2 hidden" id="entourage_no_error">
				<span class="red">Please fill entourage number.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Min Bid:</div>
			<div class="column grid_4">
				<input type="text" maxlength="10" name="min_bid" id="min_bid" value="<?php echo $items->getMinBid();?>" size="40" /> USD
			</div>
			<div class="column grid_2 hidden" id="min_bid_error">
				<span class="red">Please fill min bid.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Air Travel:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'air_travel',
										$options = coBuyerOrSellerDataConfig(),
										$selected = explode(',', $items->getAirTravel()),
										"id='air_travel' class='width270'"
									);	
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Ground:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'ground',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getGround()),
										"id='ground' class='width270'"
									);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Hotel:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'hotel',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getHotel()),
										"id='hotel' class='width270'"
									);	
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Per diem:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'per_diem',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getPerDiem()),
										"id='per_diem' class='width270'"
									);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Light & Sound:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'light_n_sound',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getLightAndSound()),
										"id='light_n_sound' class='width270'"
									);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Rider Requirement:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'rider_req',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getRiderReq()),
										"id='rider_req' class='width270'"
									);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>VISA & Work Permits:</div>
			<div class="column grid_4">
				<?php echo form_dropdown( 'visa_n_work_permits',
										$options = coBuyerOrSellerDataConfig(),
										$selected = array($items->getVisaAndWorkPermits()),
										"id='visa_n_work_permits' class='width270'"
									);
				?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red"></span>Additional Information:</div>
			<div class="column grid_6">
				<textarea maxlength="1200" name="additional" id="additional" value="" cols="65" rows="10" ><?php echo $items->getAdditional();?></textarea>
				<div class="clrboth"></div>
				<span class="red hidden" id="additional_error">Please fill additional information.</span>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Upload tech rider:</div>
			<div class="column grid_4">
				<?php echo form_upload('tech_rider',"", 'id="tech_rider" size="30"');?>
				
				<div class="clrboth"></div>
				<span class="hidden" id="tech_rider_error"><span class="red">Please upload tech rider.</span><br />
					Max file allow: <?php echo allowMaxFileSize();?> MB. <br/>
					Allow extension: <?php echo implode( ', ',allowExtensionFileDocumentUpload() );?>
				</span>
				<div class="clrboth"></div>
				<a href="<?php echo fileTarget($USER->getId(),$items->getTechRider());?>" target="_blank"><?php echo $items->getTechRider();?></a>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2"><span class="red">*</span>Upload show images<br/> (up to 3 images max):</div>
			<div class="column grid_4">
				<?php echo form_upload('show_image_1',"", 'id="show_image_1" size="30"');?> 
				<div class="clrboth"></div>
				<?php echo form_upload('show_image_2',"", 'id="show_image_2" size="30" ' );?>
				<div class="clrboth"></div>
				<?php echo form_upload('show_image_3',"", 'id="show_image_3" size="30" ');?>
				
				<div class="clrboth"></div>
				<span class="hidden" id="show_image_error"><span class="red">Please upload show image.</span><br />
					Max file allow: <?php echo allowMaxFileSize();?> MB. <br/>
					Allow extension: <?php echo implode( ', ',allowExtensionPictureUpload() );?>
				</span>
				<div class="clrboth"></div>
				<?php if($items->getShowImage1()):?>
					<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage1()),80,80);?>" /> 
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage2()):?>
					<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage2()),80,80);?>" /> 
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
				<?php if($items->getShowImage3()):?>
					<img src="<?php echo thumb(fileTarget($USER->getId(),$items->getShowImage3()),80,80);?>" /> 
					&nbsp;&nbsp;&nbsp;
				<?php endif; ?>
			</div>
			
			<div class="clrboth"></div>
			
			<div class="column grid_2">Upload hospitality rider (optional):</div>
			<div class="column grid_4">
				<?php echo form_upload('hospitality_rider',"", 'id="hospitality_rider" size="30"');?>
				
				<div class="clrboth"></div>
				<span class="hidden" id="hospitality_rider_error"><span class="red">File upload missing.</span><br />
					Max file allow: <?php echo allowMaxFileSize();?> MB. <br/>
					Allow extension: <?php echo implode( ', ',allowExtensionFileDocumentUpload() );?>
				</span>
				<div class="clrboth"></div>
				<?php if($items->getHospitalityRider()): ?>
					<a href="<?php echo fileTarget($USER->getId(),$items->getHospitalityRider());?>" target="_blank"><?php echo $items->getHospitalityRider();?></a>
				<?php endif; ?>
			</div>
			
			<div class="clrboth"></div>
				
			<br/>
			<div class="column grid_2">
				&nbsp;
				<input type="hidden" name="show_id" id="show_id" value="<?php echo $items->getId();?>" />
			</div>
			<div class="column grid_2">
				<div id="targetBack" class="red"></div>
				<div class="clrboth"></div>
				<input type="submit"  id="button_submit_show" name="button_submit_show" value="Save show" class="ui-corner-all button-yellow" />
				&nbsp;&nbsp;&nbsp;
				<?php echo loader_image(" class='hidden' id='loader' ");?>
			</div>
		
			<div class="clrboth"></div>
		</div>
	</div>
	
</form>	

<div class="clrboth"></div>

